<?php defined('BASEPATH') OR exit('No direct script access allowed');

class Auth_class extends CI_Model {

	public function active_session(){
		$isLoggedin 		= $this->session->userdata('user_logged_in');
		$isEmailSet			= $this->session->userdata('strEmail');
		$isAccountTypeSet 	= $this->session->userdata('intAccountType');
		
		if(isset($isEmailSet) && $isLoggedin=='1'){
			header('location:'.base_url().'dashboard');
		}
	}
	public function no_session(){
		$isLoggedin 		= $this->session->userdata('user_logged_in');
		$isEmailSet			= $this->session->userdata('strEmail');
		$isAccountTypeSet 	= $this->session->userdata('intAccountType');
		
		if($isEmailSet=='' && $isLoggedin==''){
			header('location:'.base_url());
		}
		if(!isset($isEmailSet)){
			header('location:'.base_url());
		}
	}

	public function front_active_session(){
		$isLoggedin 		= $this->session->userdata('user_logged_in');
		$isEmailSet			= $this->session->userdata('strEmail');
		$isAccountTypeSet 	= $this->session->userdata('intAccountType');
		
		if(isset($isEmailSet) && $isLoggedin=='1'){
			header('location:'.base_url());
		}
	}
	public function front_no_session(){
		$isLoggedin 		= $this->session->userdata('user_logged_in');
		$isEmailSet			= $this->session->userdata('strEmail');
		$isAccountTypeSet 	= $this->session->userdata('intAccountType');
		
		if($isEmailSet=='' && $isLoggedin==''){
			header('location:'.base_url());
		}
		if(!isset($isEmailSet)){
			header('location:'.base_url());
		}
	}
}